package com.dailyblue.java.spring.cloud.alibaba.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@Slf4j
public class ExampleNacosConfigApplication {
    public static void main(String[] args) throws Exception{
        ConfigurableApplicationContext context = SpringApplication.run(ExampleNacosConfigApplication.class, args);
        /*// 动态获取到 config 配置中心的内容
        while(true){
            String name = context.getEnvironment().getProperty("my.user.name");
            String age = context.getEnvironment().getProperty("my.user.age");
            log.info("name:{},age:{}", name, age);
            Thread.sleep(1000);
        }*/
    }
}
